home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / Tool Chest / Development Tools & Languages / • Other Platforms / PCCTS / h / config.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-14  |  4.5 KB  |  197 lines  |  [TEXT/MPS ]

  1. #ifndef CONFIG_H
  2. #define CONFIG_H
  3. /*
  4.  * config.h (for ANTLR, DLG, and SORCERER)
  5.  *
  6.  * This is a simple configuration file that doesn't have config stuff
  7.  * in it, but it's a start.
  8.  *
  9.  * SOFTWARE RIGHTS
  10.  *
  11.  * We reserve no LEGAL rights to the Purdue Compiler Construction Tool
  12.  * Set (PCCTS) -- PCCTS is in the public domain.  An individual or
  13.  * company may do whatever they wish with source code distributed with
  14.  * PCCTS or the code generated by PCCTS, including the incorporation of
  15.  * PCCTS, or its output, into commerical software.
  16.  * 
  17.  * We encourage users to develop software with PCCTS.  However, we do ask
  18.  * that credit is given to us for developing PCCTS.  By "credit",
  19.  * we mean that if you incorporate our source code into one of your
  20.  * programs (commercial product, research project, or otherwise) that you
  21.  * acknowledge this fact somewhere in the documentation, research report,
  22.  * etc...  If you like PCCTS and have developed a nice tool with the
  23.  * output, please mention that you developed it using PCCTS.  In
  24.  * addition, we ask that this header remain intact in our source code.
  25.  * As long as these guidelines are kept, we expect to continue enhancing
  26.  * this system and expect to make other tools available as they are
  27.  * completed.
  28.  *
  29.  * Used by PCCTS 1.23 (SORCERER 1.00B11)
  30.  * Terence Parr
  31.  * Parr Research Corporation
  32.  * with Purdue University and AHPCRC, University of Minnesota
  33.  * 1989-1994
  34.  */
  35.  
  36. /* This file knows about the following ``environments''
  37.     UNIX (default)
  38.     DOS  (use #define PC)
  39.     MAC  (use #define MPW; has a few things for THINK C, Metrowerks)
  40.  */
  41.  
  42. /* should test __STDC__ for 1, but some compilers don't set value, just def */
  43. #ifdef __STDC__
  44. #define __USE_PROTOS
  45. #endif
  46. #ifdef __cplusplus
  47. #ifndef __USE_PROTOS
  48. #define __USE_PROTOS
  49. #endif
  50. #endif
  51.  
  52. #define ATOKEN_H            "AToken.h"
  53. #define ATOKENBUFFER_H        "ATokenBuffer.h"
  54. #define ATOKENBUFFER_C        "ATokenBuffer.C"
  55. #define ATOKENSTREAM_H        "ATokenStream.h"
  56. #define APARSER_H            "AParser.h"
  57. #define APARSER_C            "AParser.C"
  58. #define ASTBASE_H            "ASTBase.h"
  59. #define ASTBASE_C            "ASTBase.C"
  60. #define DLEXERBASE_H        "DLexerBase.h"
  61. #define DLEXERBASE_C        "DLexerBase.C"
  62. #define DLEXER_C            "DLexer.C"
  63.  
  64. #ifdef MPW
  65. #define CPP_FILE_SUFFIX        ".cp"
  66. #define OBJ_FILE_SUFFIX        ".o"
  67. #else
  68. #ifdef PC
  69. #define CPP_FILE_SUFFIX        ".cpp"
  70. #define OBJ_FILE_SUFFIX        ".obj"
  71. #else
  72. #define CPP_FILE_SUFFIX        ".C"
  73. #define OBJ_FILE_SUFFIX        ".o"
  74. #endif
  75. #endif
  76.  
  77. /* User may redefine how line information looks */
  78. #define LineInfoFormatStr "# %d \"%s\"\n"
  79.  
  80. #ifdef MPW        /* Macintosh Programmer's Workshop */
  81. #define ErrHdr "File \"%s\"; Line %d #"
  82. #else
  83. #define ErrHdr "%s, line %d:"
  84. #endif
  85.  
  86.  
  87. /* must assume old K&R cpp here, can't use #if defined(..)... */
  88.  
  89. #ifdef MPW
  90. #define TopDirectory    ":"
  91. #define DirectorySymbol    ":"
  92. #define OutputDirectoryOption "Directory where all output files should go (default=\":\")"
  93. #else
  94. #ifdef PC
  95. #define TopDirectory    "."
  96. #define DirectorySymbol    "\\"
  97. #define OutputDirectoryOption "Directory where all output files should go (default=\".\")"
  98. #else
  99. #define TopDirectory    "."
  100. #define DirectorySymbol    "/"
  101. #define OutputDirectoryOption "Directory where all output files should go (default=\".\")"
  102. #endif
  103. #endif
  104.  
  105. #ifdef MPW
  106.  
  107. /* Make sure we have prototypes for all functions under MPW */
  108.  
  109. #include <string.h>
  110. #include <stdlib.h>
  111. #include <CursorCtl.h>
  112. #ifdef __cplusplus
  113. extern "C" {
  114. #endif
  115. extern void fsetfileinfo (char *filename, unsigned long newcreator, unsigned long newtype);
  116. #ifdef __cplusplus
  117. }
  118. #endif
  119.  
  120. /* File creators for various popular development environments */
  121.  
  122. #define MAC_FILE_CREATOR 'MPS '   /* MPW Text files */
  123. #if 0
  124. #define MAC_FILE_CREATOR 'KAHL'   /* THINK C/Symantec C++ Text files */
  125. #endif
  126. #if 0
  127. #define MAC_FILE_CREATOR 'MMCC'   /* Metrowerks C/C++ Text files */
  128. #endif
  129.  
  130. #endif
  131.  
  132. #ifdef MPW
  133. #define DAWDLE    SpinCursor(1)
  134. #else
  135. #define DAWDLE
  136. #endif
  137.  
  138. #ifdef __cplusplus
  139. inline
  140. #else
  141. static
  142. #endif
  143. #ifdef MPW
  144. void special_inits()
  145. {
  146.   InitCursorCtl((acurHandle) 0);
  147. }
  148. #else
  149. void special_inits()
  150. {
  151. }
  152. #endif
  153.  
  154. #ifdef __cplusplus
  155. inline
  156. #else
  157. static
  158. #endif
  159. #ifdef MPW
  160. void special_fopen_actions(char *s)
  161. {
  162.   fsetfileinfo (s, MAC_FILE_CREATOR, 'TEXT');
  163. }
  164. #else
  165. void
  166. #ifdef __USE_PROTOS
  167. special_fopen_actions(char *s)
  168. #else
  169. special_fopen_actions(s)
  170. char *s;
  171. #endif
  172. {
  173. }
  174. #endif
  175.  
  176. /* Define usable bits for set.c stuff */
  177. #define BytesPerWord    sizeof(unsigned)
  178. #define    WORDSIZE        (sizeof(unsigned)*8)
  179. #define LogWordSize     (WORDSIZE==16?4:5)
  180.  
  181. #ifndef TRUE
  182. #define TRUE 1
  183. #endif
  184. #ifndef FALSE
  185. #define FALSE 0
  186. #endif
  187.  
  188. #ifdef VAXC
  189. #define DIE        return 0;
  190. #define DONE    return 1;
  191. #else
  192. #define DIE        return 1;
  193. #define DONE    return 0;
  194. #endif
  195.  
  196. #endif
  197.